import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-04-18
 * Time: 22:47
 */
public class IOdemo2 {
    public static void main(String[] args) {
        try (InputStream stream = new FileInputStream("./test03.txt")) {
            byte[] b = new byte[10]; // 越界读取到负值：[-61, -65, 0, 0, 0, 0, 0, 0, 0, 0]
            stream.read(b);
            System.out.println(Arrays.toString(b));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
